﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BankOCR
{
    public class SingleChangeSymbolFixer : ISymbolFixer
    {
        public IEnumerable<DigitalSymbol> FindValidSymbolsFor(DigitalSymbol symbol)
        {
            for (var row = 0; row < 3; row++)
                for (var col = 0; col < 3; col++) {
                    var newSymbol = new DigitalSymbol(symbol);
                    newSymbol.ToggleCharAt(row, col);
                    if (DigitalSymbol.AllKnownSymbols.Contains(newSymbol))
                        yield return newSymbol;
                }
        }
    }
}
